#include <iostream>

/* 代理模式 */
class RentHouse {
    public:
        virtual void rentHouse() = 0;
};


class Landlord : public RentHouse {
    public:
        void rentHouse() {
            std::cout << "房子租出去了" << std::endl;
        }
};

class Intermediary : public RentHouse {
    public:
        void rentHouse() {
            std::cout << "发布招租启事" << std::endl;
            std::cout << "带人看房" << std::endl;
            _landload.rentHouse();
            std::cout << "负责租后维修" << std::endl;
        }
    private:
        Landlord _landload;
};

int main() {
    Intermediary intermediary;
    intermediary.rentHouse();
    return 0;
}